// babel-preset-taro 更多选项和默认值：
// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
module.exports = {
    presets: [
        '@babel/preset-typescript', // 确保TypeScript处理最先进行
        ['taro',
            {
                framework: 'react',
                ts: true,
                compiler: 'webpack5',
            }]
    ],
    plugins: [
        // 支持类属性和方法
        '@babel/plugin-transform-class-properties',
        '@babel/plugin-transform-private-methods',
        ['@babel/plugin-proposal-decorators', { legacy: true }],
        // 类特性插件
        // '@babel/plugin-transform-class-properties',
        // '@babel/plugin-transform-private-methods',
        // '@babel/plugin-proposal-decorators',
        // 保持原有的import插件
        [
            "import",
            {
                "libraryName": "@nutui/nutui-react-taro",
                "libraryDirectory": "dist/esm",
                "style": 'css',
                "camel2DashComponentName": false
            },
            'nutui-react-taro'
        ]
    ]
}